// ml:run = $bin < input
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int n;
int li[200000];
int main()
{
    scanf("%d", &n);
    li[0]=0
        int cnt=1;
    for (int i=1;i<n;i++)
        for (int j=i+1;j<=n;j++){
            li[cnt++]=i;
            li[cnt++]=j;
        }
    li[cnt++]=0;
    printf("1 1 0\n");
    for (int i=2;i<cnt-1;i++)
        printf("%d %d %d\n", li[i], li[i], li[i-1]);
    printf("0 1 %d\n", n);
    return 0;
}

